﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.DataAnnotations;

namespace TestEnvirementCL.POCO
{
  public class Record
  {
    //Attributes of the Table
    public int RecordId { get; set; }
    public string RecordHolder { get; set; }
    public double Result { get; set; }
    
    //Foreign Keys
    public int EventId { get; set; }
    public int MeetingId { get; set; }
    
    //Relations to other Tables
    public virtual Event Event { get; set; }
    
    public virtual Meeting Meeting { get; set; }

    public int getForeignKeyId(object primaryClass)
    {
      if (primaryClass.GetType() == Event.GetType())
      {
        return EventId;
      }
      else
      {
        return MeetingId;
      }
    }
    public int getId()
    {
      return RecordId;
    }
  }
}
